<template>
  <div class="content">
    <grouplist :total="this.sum" :data="this.userList.slice((currentPage-1)*pagesize,currentPage*pagesize)"></grouplist>
  </div>
</template>

<script>
  export default {
    props: {
      transport_data: String
    },
    data() {
      return {
        userList: [],
        permission: this.$store.state.permission,
        currentPage: 1, //初始页
        pagesize: 6,
        sum:'',
      }
    },
    created(){
      this.loadUsers(1,6)
    },
    methods: {
      loadUsers(page,size) {
        this.$axios.get('/api/Group/AdminShowGroup', {
            params: {
              AdminId: this.$store.state.userId,
              page: page,
              size: size,
            },
          })
          .then(res => {
            this.userList = res.data.data.list;
            this.sum=res.data.data.total;
            console.log('sum :>> ', this.sum);
          })
          .catch(err => {
            console.log(err)
          })
      },

    },
  };
</script>

<style>
</style>
